<template>
    <div>
		<mescroll-vue ref="mescroll0" :up="getMescrollUp(0)" @init="mescrollInit0">
			<div id='dataList0'>
				<div style="padding: 0;" v-for="(item,index) in tab0.list" :key="index">
					<p class="p1">{{item.addtime}}</p>
					<div class="top">
						
						<div class="toptitile">{{item.title}}</div>
						<p class="bto">
							<span  v-if="item.msg_type==1||item.msg_type=='1'">评价：</span>
							<span v-else-if="item.msg_type==2||item.msg_type=='2'">笔记:</span>
							<span v-else-if="item.msg_type==3||item.msg_type=='3'">收藏:</span>
							<!-- <span class="btocontent">{{item.content}}</span> -->
							<span class="btocontent">{{item.content | base64Decode}}</span>
						</p>

					</div>
				</div>
			</div>
		</mescroll-vue>
    </div>
</template>

<script>
	import MescrollVue from 'mescroll.js/mescroll.vue'
    export default {
        name: "Zan",
		components: {
		  MescrollVue
		},
      data(){
          return{
			imgSrc: require("../../assets/img/kongbai.png"),
			tabType: 0 ,// 菜单类型
			tab0: {mescroll: null, list: [], isListInit: false}, // 全部
			chenload:false,
            arr:[],
			allLoaded:false,
			page:1,
          }
      },
		methods:{
			mescrollInit0 (mescroll) {
			  mescroll.tabType = 0; // 加入标记,便于在回调中取到对应的list
			  this.tab0.mescroll = mescroll;
			},
			
			getMescrollUp (tabType) {
			  let emptyWarpId = 'dataList' + tabType;
			  return {
				auto: true,
				callback: this.upCallback, // 上拉回调,此处可简写; 相当于 callback: function (page) { upCallback(page); }
				noMoreSize: 5, // 如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
					   empty: {
						 warpId: 'dataList0', // 父布局的id;
						 icon: this.imgSrc, // 图标,默认null
						 tip: '您暂未收到任何赞', // 提示
						 
					   },
			  }
			},
			upCallback (page, mescroll) {
			  if (mescroll.tabType === 0) {
				// 全部
				this.tab0.isListInit = true;// 标记列表已初始化,保证列表只初始化一次
					this.axios.get(this.$store.state.url +'User/receiveLike',{
						 params:{
							page: page.num,
							limit:page.size
						 }
					 }).then(res=>{
										// console.log(res.data.data.class)
						this.chenload = true;
						if(res.data.errcode==0||res.data.errcode=='0'){
								var curPageData = res.data.data.msgs;
								mescroll.endSuccess(curPageData.length);// 联网成功的回调,隐藏下拉刷新和上拉加载的状态;
								 if (page.num === 1) this.tab0.list = []; // 如果是第一页需手动制空列表
								 this.tab0.list = this.tab0.list.concat(curPageData); // 追加新数据
								 // this.tab0.list=res.data.data.order
						}
					
					})
			  }
			},
		},
		mounted(){
			this.sdk.getJSSDK('','',this.$store.state.url);	
		}
    }
</script>

<style scoped>
	.mescroll {
	  position: fixed;
	  top: 0rem;
	  bottom: 0;
	  height: auto;
	}
	.toptitile{
		padding: 0 .3rem;
		height: .9rem;
		line-height: .9rem;
		color: #333333;
		font-size: .3rem;
	}
  
  .p1{
	line-height: .75rem;
    text-align: center;
    font-size:0.26rem;
    font-weight:500;
    color:rgba(153,153,153,1);
    background: #F7F7F7;
  }
  .top{
	  width: 7.5rem;
	  margin-top: .2rem;
	  
	  background: #fff;
  }
  .bto{
    word-wrap:break-word;
  }
  .bto{
    width: 92%;
    margin:0rem auto 0;
    /* margin-top: ; */
	padding: .3rem 0;
	border-top: 1px solid #ededed;
  }
  .bto span:nth-child(1){
  font-size: 0.26rem;
    color: #333;
  }
  .bto span:nth-child(2){
    font-size: 0.26rem;
    color: #999;
    line-height: 0.34rem;
  }
</style>
